package com.knowswift.api.config;

import com.knowswift.common.common.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;


@RestController
@Slf4j
public class FallBackController {

    @RequestMapping("/fallBack")
    public BaseResponse fallback(ServerWebExchange exchange, Throwable throwable) {
        log.error(throwable.getMessage(), throwable);
        return BaseResponse.failure("服务正忙，请稍后再试...");
    }
}
